Other Protocols
The following protocols are available globally.
-
The
EventsManagerDataSource
protocol declares values required for recording route following events.Declaration
Swift
@objc public protocol EventsManagerDataSource : AnyObject
-
A navigation service delegate interacts with one or more
NavigationService
instances (such asMapboxNavigationService
objects) during turn-by-turn navigation. This protocol is the main way that your application can synchronize its state with the SDK’s location-related functionality. Each of the protocol’s methods is optional.As the user progresses along a route, a navigation service informs its delegate about significant events as they occur, and the delegate has opportunities to influence the route and its presentation. For example, when the navigation service reports that the user has arrived at the destination, your delegate implementation could present information about the destination. It could also customize individual visual or spoken instructions along the route by returning modified instruction objects.
Assign a
NavigationServiceDelegate
instance to theNavigationService.delegate
property of the navigation service before you start the service.The
RouterDelegate
protocol defines corresponding methods so that aRouter
instance can interact with an object that is both a router delegate and a navigation service, which in turn interacts with a navigation service delegate. Additionally, several location-related methods in this protocol have corresponding methods in theNavigationViewControllerDelegate
protocol, which can be convenient if you are using the navigation service in conjunction with aNavigationViewController
. Normally, you would either implement methods inNavigationServiceDelegate
orNavigationViewControllerDelegate
but notRouterDelegate
.Seealso
NavigationViewControllerDelegateSeealso
RouterDelegateDeclaration
Swift
@objc public protocol NavigationServiceDelegate
-
A router data source, also known as a location manager, supplies location data to a
See moreRouter
instance. For example, aMapboxNavigationService
supplies location data to aRouteController
orLegacyRouteController
.Declaration
Swift
@objc(MBRouterDataSource) public protocol RouterDataSource
-
A class conforming to the
Router
protocol tracks the user’s progress as they travel along a predetermined route. It calls methods on itsdelegate
, which conforms to theRouterDelegate
protocol, whenever significant events or decision points occur along the route. Despite its name, this protocol does not define the interface of a routing engine.There are two concrete implementations of the
See moreRouter
protocol.RouteController
, the default implementation, is capable of client-side routing and depends on the Mapbox Navigation Native framework.LegacyRouteController
is an alternative implementation that does not have this dependency but must be used in conjunction with the Mapbox Directions API over a network connection.Declaration
Swift
@objc public protocol Router : AnyObject, CLLocationManagerDelegate
-
A router delegate interacts with one or more
Router
instances, such asRouteController
objects, during turn-by-turn navigation. This protocol is similar toNavigationServiceDelegate
, which is the main way that your application can synchronize its state with the SDK’s location-related functionality. Normally, you should not need to make a class conform to theRouterDelegate
protocol or call any of its methods directly, but you would need to call this protocol’s methods if you implement a customRouter
class.MapboxNavigationService
is the only concrete implementation of a router delegate. Implement theNavigationServiceDelegate
protocol instead to be notified when various significant events occur along the route tracked by aNavigationService
.Seealso
MapboxNavigationServiceSeealso
NavigationServiceDelegateDeclaration
Swift
@objc(MBRouterDelegate) public protocol RouterDelegate : AnyObject
-
See moreBottomBannerViewControllerDelegate
provides a method for reacting to the user tapping on the “cancel” button in theBottomBannerViewController
.Declaration
Swift
public protocol BottomBannerViewControllerDelegate : AnyObject
-
A cache consists of both in-memory and on-disk components, both of which can be reset.
Declaration
Swift
@objc(MBBimodalCache) public protocol BimodalCache
-
A cache which supports storing images
Declaration
Swift
@objc(MBBimodalImageCache) public protocol BimodalImageCache : BimodalCache
-
A cache which supports storing data
Declaration
Swift
@objc(MBBimodalDataCache) public protocol BimodalDataCache : BimodalCache
-
The
See moreFeedbackViewControllerDelegate
protocol provides methods for responding to feedback events.Declaration
Swift
@objc public protocol FeedbackViewControllerDelegate
-
The
See moreVisualInstructionDelegate
protocol defines a method that allows an object to customize presented visual instructions.Declaration
Swift
@objc(MBVisualInstructionDelegate) public protocol VisualInstructionDelegate : AnyObject
-
See moreInstructionsBannerViewDelegate
provides methods for reacting to user interactions inInstructionsBannerView
.Declaration
Swift
@objc(MBInstructionsBannerViewDelegate) public protocol InstructionsBannerViewDelegate : AnyObject
-
The
See moreInstructionsCardContainerViewDelegate
protocol defines a method that allows an object to customize presented visual instructions within the instructions container view.Declaration
Swift
@objc(MBInstructionsCardContainerViewDelegate) public protocol InstructionsCardContainerViewDelegate : VisualInstructionDelegate
-
The NavigationInteractionDelegate protocol is used to define interaction events that the top banner may need to know about.
See moreDeclaration
Swift
@objc public protocol NavigationMapInteractionObserver : AnyObject
-
The CarPlayConnectionObserver protocol provides notification of a carplay unit connecting two the NavigationViewController.
See moreDeclaration
Swift
@objc public protocol CarPlayConnectionObserver : AnyObject
-
This protocol defines a UI Component that is capable of presenting a status message.
See moreDeclaration
Swift
@objc public protocol NavigationStatusPresenter : AnyObject
-
The
See moreNavigationMapViewCourseTrackingDelegate
provides methods for responding to theNavigationMapView
starting or stopping course tracking.Declaration
Swift
@objc(MBNavigationMapViewCourseTrackingDelegate) public protocol NavigationMapViewCourseTrackingDelegate : AnyObject
-
The
See moreVoiceControllerDelegate
protocol defines methods that allow an object to respond to significant events related to spoken instructions.Declaration
Swift
@objc(MBVoiceControllerDelegate) public protocol VoiceControllerDelegate
-
A protocol for listening in on changes made to a
See moreStatusView
.Declaration
Swift
@available(*, deprecated, message: "Add a target to StatusView for UIControl.Event.valueChanged instead.") @objc public protocol StatusViewDelegate : DeprecatedStatusViewDelegate
-
See moreStepsViewControllerDelegate
provides methods for user interactions in aStepsViewController
.Declaration
Swift
@objc public protocol StepsViewControllerDelegate : AnyObject
-
The
See moreStyleManagerDelegate
protocol defines a set of methods used for controlling the style.Declaration
Swift
@objc(MBStyleManagerDelegate) public protocol StyleManagerDelegate : NSObjectProtocol
-
A view that represents the user’s location and course on a
See moreNavigationMapView
.Declaration
Swift
@objc(MBUserCourseView) public protocol UserCourseView : UIView